package DesignPattern;

import java.lang.reflect.Constructor;

public enum Instance {
    INSTANCE;

    public static Instance getInstance() {
        return INSTANCE;
    }

    public static void main(String[] args) throws Exception{
        Instance instance1 = Instance.getInstance();

        Constructor<Instance> declaredConstructor = Instance.class.getDeclaredConstructor(null);
        declaredConstructor.setAccessible(true);

        Instance instance2 = declaredConstructor.newInstance();

        System.out.println(instance1);
        System.out.println(instance2);

    }
}
